package behavioral.observer;

public class ObserverPattern {
    public static void main(String[] args) {
        DataSource dataSource = new DataSource();
        Observer observer1 = new Sheet(dataSource);
        Observer observer2 = new Chart(dataSource);

        dataSource.setValue(10);
        dataSource.setValue(20);

        dataSource.removeObserver(observer1);
        dataSource.setValue(30);
    }
}
